<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<%@page import="business.BusinessEvent"%>
<%@page import="domain.User"%>
<%@page import="business.BusinessUser"%>
<%@page import="java.io.PrintWriter"%>
<%@page import="java.util.*" %>
<%@ page language="java" import="domain.Event,java.util.*" %> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>PerSel | Tus eventos creados</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<script type="text/javascript">
	
	
	
	</script>
	
	<!-- Stylesheets -->
	<link rel="stylesheet" href="css/reset.css" />
	<link rel="stylesheet" href="css/styles.css" />
	<link rel="stylesheet" href="css/input.css" />
	
	<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="js/input.js"></script>
	<!-- Scripts -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
	<!--[if IE 6]>
	<script src="js/DD_belatedPNG_0.0.8a-min.js"></script>
	<script>
	  /* EXAMPLE */
	  DD_belatedPNG.fix('.button');
	  
	  /* string argument can be any CSS selector */
	  /* .png_bg example is unnecessary */
	  /* change it to what suits you! */
	</script>
	<![endif]-->
	
</head>

<body class="portfolio">

	<div id="wrapper" class="container_12 clearfix">

		<!-- Text Logo -->
		<h1 id="logo" class="grid_4"><a href="index.jsp">PelSer</a></h1>
		<div>
		<!-- Navigation Menu -->
        <ul id="navigation" class="grid_8">
            <li><a href="films.jsp"><span class="meta">Tus Peliculas</span><br />Top</a></li>
            <li><a href="messages.html"><span class="meta">Tus mensajes</span><br />Mensajes</a></li>
            <li><a href="friends.jsp"><span class="meta">Tus Amigos</span><br />Amigos</a></li>
            <li><a href="profile.jsp"><span class="meta">Tu perfil</span><br />Perfil</a></li>
            <li><a href="wall.jsp" class="current"><span class="meta">Novedades</span><br />Muro</a></li>
        </ul></div><div>
        	<table width="100%">
        	<tr>
        		<td>
        		<form action="FrontControllerSearch" method="post">
        		<label class="input">
    			<span>Buscar...</span>
    			<input type="text"  name="busquedaSimple"/>
				</label>
        		<input type="hidden" name="rdtema" value="buscarSimple"/>
				<a href="search.jsp">Busqueda Avanzada</a>
				</form>
				</td>
        	 	
        	 	<% if(session.getAttribute("session.user")!=null){
        	 		User usuario= (User)(session.getAttribute("session.user"));
        	 		
        	 	%>
        	 	
        	 	<td align="right">
        	 	<form action="FrontControllerLogin?accion=logout" method="post">
        	 	<input type="image" title="Salir" src="images/logout.gif" ondblclick="this.form.submit()"></input>
        	 	</form>
        	 	 
        	 	<% 
        	 	out.print("<i>Bienvenid@: <b>"+usuario.getName()+" "+usuario.getSurname()+"</b></i>");
        	 	
        	 	} %>
        	 	
        	 	</td>
        	</tr>
        	</table>
        </div>
		<div class="hr grid_12 clearfix">&nbsp;</div>
			
		<!-- Catch Line and Link -->
			
		
		
		
		<!-- Portfolio Items -->
		
		<!-- Section 1 -->	
		<!-- Section 3 -->
		<div class="catagory_1 clearfix">
			<!-- Row 1 -->
			<div class="grid_3 textright" >
		
			
			<!--  	<div class="hr clearfix dotted">&nbsp;</div>-->
				
			</div>
<div class="grid_9">
<h4>Mis Eventos</h4>

<%
User usuario= (User)(session.getAttribute("session.user"));
List<Event> events = BusinessEvent.getAllEventsByUser(usuario.getLogin());
Integer contador = 0;
for(Event event : events){
	
	if(contador%3==0){%>
		<a class="portfolio_item float alpha" href="event.jsp?idEvento=<%out.print(event.getIdEvent()); %>" >
		<%out.println(event.getName()); %>
		</a>
 <%}else if(contador%3==1){%>
		<a class="portfolio_item float" href="event.jsp?idEvento=<%out.print(event.getIdEvent()); %>">
		<%out.println(event.getName()); %>
		</a>
 <%}else if(contador%3==2){%>
		<a class="portfolio_item float omega" href="event.jsp?idEvento=<%out.print(event.getIdEvent()); %>">
		<%out.println(event.getName()); %>
		</a>
<%	}
	contador++;
}	
%>

	

</div>
</div>

			
		<div class="hr grid_12 clearfix">&nbsp;</div>
		
		<!-- Footer -->
		<p class="grid_12 footer clearfix">
			<span class="float"><b>&copy; Copyright</b> <a href="">Grupo 12</a></span>
			<a class="float right" href="#">Subir</a>
		</p>
		
	</div><!--end wrapper-->

</body>
</html>
